home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK2.toast / Development Kits / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / CMICCProfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  31.5 KB  |  943 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        CMICCProfile.h
  3.  
  4.      Contains:    ICC Profile Format Definitions
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CMICCPROFILE__
  19. #define __CMICCPROFILE__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47. /* Current CMProfile.header.profileVersion Major: 2, Minor: 0, Stage: Developement (x20), Prerelease:0x01 */
  48.  
  49. enum {
  50.     cmCS2ProfileVersion            = 0x02000000
  51. };
  52.  
  53. /* Current Major version number */
  54.  
  55. enum {
  56.     cmCurrentProfileMajorVersion = 0x02000000
  57. };
  58.  
  59. /* magic cookie number for anonymous file ID */
  60.  
  61. enum {
  62.     cmMagicNumber                = FOUR_CHAR_CODE('acsp')
  63. };
  64.  
  65. /* ColorSync profile version 1.0 */
  66.  
  67. enum {
  68.     cmCS1ProfileVersion            = 0x00000100
  69. };
  70.  
  71.  
  72. /************************************************************************/
  73. /*************** ColorSync 2.0 profile specification ********************/
  74. /************************************************************************/
  75. /**** flags field  ****/
  76.  
  77. enum {
  78.     cmICCReservedFlagsMask        = 0x0000FFFF,                    /* these bits of the flags field are defined and reserved by ICC */
  79.     cmEmbeddedMask                = 0x00000001,                    /* if bit 0 is 0 then not embedded profile, if 1 then embedded profile */
  80.     cmEmbeddedUseMask            = 0x00000002,                    /* if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only */
  81.     cmCMSReservedFlagsMask        = (long)0xFFFF0000,                /* these bits of the flags field are defined and reserved by CMS vendor */
  82.     cmQualityMask                = 0x00030000,                    /* if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best */
  83.     cmInterpolationMask            = 0x00040000,                    /* if bit 18 is 0 then interpolation, if 1 then lookup only */
  84.     cmGamutCheckingMask            = 0x00080000                    /* if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info */
  85. };
  86.  
  87. /* copyright-protection flag options */
  88.  
  89. enum {
  90.     cmEmbeddedProfile            = 0,                            /* 0 is not embedded profile, 1 is embedded profile */
  91.     cmEmbeddedUse                = 1                                /* 0 is to use anywhere, 1 is to use as embedded profile only */
  92. };
  93.  
  94. /* speed and quality flag options */
  95.  
  96. enum {
  97.     cmNormalMode                = 0,                            /* it uses the least significent two bits in the high word of flag */
  98.     cmDraftMode                    = 1,                            /* it should be evaulated like this: right shift 16 bits first, mask off the */
  99.     cmBestMode                    = 2                                /* high 14 bits, and then compare with the enum to determine the option value */
  100. };
  101.  
  102.  
  103. /**** deviceAttributes fields ****/
  104.  
  105. enum {
  106.     cmICCReservedAttr0Mask        = 0x0000FFFF,                    /* these bits of the deviceAttributes[0] field are defined and reserved by ICC */
  107.     cmReflectiveTransparentMask    = 0x00000001,                    /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  108.     cmGlossyMatteMask            = 0x00000002,                    /* if bit 1 is 0 then glossy, if 1 then matte */
  109.     cmVendorReservedAttr0Mask    = (long)0xFFFF0000,                /* these bits of the deviceAttributes[0] field are defined and reserved by device vendor */
  110.     cmVendorReservedAttr1Mask    = (long)0xFFFFFFFF                /* these bits of the deviceAttributes[1] field are defined and reserved by device vendor */
  111. };
  112.  
  113. /* device/media attributes element values  */
  114.  
  115. enum {
  116.     cmReflective                = 0,                            /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  117.     cmGlossy                    = 1                                /* if bit 1 is 0 then glossy, if 1 then matte */
  118. };
  119.  
  120.  
  121. /**** renderingIntent field ****/
  122.  
  123. enum {
  124.     cmPerceptual                = 0,                            /* Photographic images */
  125.     cmRelativeColorimetric        = 1,                            /* Logo Colors */
  126.     cmSaturation                = 2,                            /* Business graphics */
  127.     cmAbsoluteColorimetric        = 3                                /* Logo Colors */
  128. };
  129.  
  130.  
  131.  
  132. /* data type element values */
  133.  
  134. enum {
  135.     cmAsciiData                    = 0,
  136.     cmBinaryData                = 1
  137. };
  138.  
  139. /* screen encodings  */
  140.  
  141. enum {
  142.     cmPrtrDefaultScreens        = 0,                            /* Use printer default screens.  0 is false, 1 is ture */
  143.     cmLinesPer                    = 1                                /* 0 is LinesPerCm, 1 is LinesPerInch */
  144. };
  145.  
  146. /* 2.0 tag type information */
  147.  
  148. enum {
  149.     cmNumHeaderElements            = 10
  150. };
  151.  
  152. /* public tags */
  153.  
  154. enum {
  155.     cmAToB0Tag                    = FOUR_CHAR_CODE('A2B0'),
  156.     cmAToB1Tag                    = FOUR_CHAR_CODE('A2B1'),
  157.     cmAToB2Tag                    = FOUR_CHAR_CODE('A2B2'),
  158.     cmBlueColorantTag            = FOUR_CHAR_CODE('bXYZ'),
  159.     cmBlueTRCTag                = FOUR_CHAR_CODE('bTRC'),
  160.     cmBToA0Tag                    = FOUR_CHAR_CODE('B2A0'),
  161.     cmBToA1Tag                    = FOUR_CHAR_CODE('B2A1'),
  162.     cmBToA2Tag                    = FOUR_CHAR_CODE('B2A2'),
  163.     cmCalibrationDateTimeTag    = FOUR_CHAR_CODE('calt'),
  164.     cmCharTargetTag                = FOUR_CHAR_CODE('targ'),
  165.     cmCopyrightTag                = FOUR_CHAR_CODE('cprt'),
  166.     cmDeviceMfgDescTag            = FOUR_CHAR_CODE('dmnd'),
  167.     cmDeviceModelDescTag        = FOUR_CHAR_CODE('dmdd'),
  168.     cmGamutTag                    = FOUR_CHAR_CODE('gamt'),
  169.     cmGrayTRCTag                = FOUR_CHAR_CODE('kTRC'),
  170.     cmGreenColorantTag            = FOUR_CHAR_CODE('gXYZ'),
  171.     cmGreenTRCTag                = FOUR_CHAR_CODE('gTRC'),
  172.     cmLuminanceTag                = FOUR_CHAR_CODE('lumi'),
  173.     cmMeasurementTag            = FOUR_CHAR_CODE('meas'),
  174.     cmMediaBlackPointTag        = FOUR_CHAR_CODE('bkpt'),
  175.     cmMediaWhitePointTag        = FOUR_CHAR_CODE('wtpt'),
  176.     cmNamedColorTag                = FOUR_CHAR_CODE('ncol'),
  177.     cmNamedColor2Tag            = FOUR_CHAR_CODE('ncl2'),
  178.     cmPreview0Tag                = FOUR_CHAR_CODE('pre0'),
  179.     cmPreview1Tag                = FOUR_CHAR_CODE('pre1'),
  180.     cmPreview2Tag                = FOUR_CHAR_CODE('pre2'),
  181.     cmProfileDescriptionTag        = FOUR_CHAR_CODE('desc'),
  182.     cmProfileSequenceDescTag    = FOUR_CHAR_CODE('pseq'),
  183.     cmPS2CRD0Tag                = FOUR_CHAR_CODE('psd0'),
  184.     cmPS2CRD1Tag                = FOUR_CHAR_CODE('psd1'),
  185.     cmPS2CRD2Tag                = FOUR_CHAR_CODE('psd2'),
  186.     cmPS2CRD3Tag                = FOUR_CHAR_CODE('psd3'),
  187.     cmPS2CSATag                    = FOUR_CHAR_CODE('ps2s'),
  188.     cmPS2RenderingIntentTag        = FOUR_CHAR_CODE('ps2i'),
  189.     cmRedColorantTag            = FOUR_CHAR_CODE('rXYZ'),
  190.     cmRedTRCTag                    = FOUR_CHAR_CODE('rTRC'),
  191.     cmScreeningDescTag            = FOUR_CHAR_CODE('scrd'),
  192.     cmScreeningTag                = FOUR_CHAR_CODE('scrn'),
  193.     cmTechnologyTag                = FOUR_CHAR_CODE('tech'),
  194.     cmUcrBgTag                    = FOUR_CHAR_CODE('bfd '),
  195.     cmViewingConditionsDescTag    = FOUR_CHAR_CODE('vued'),
  196.     cmViewingConditionsTag        = FOUR_CHAR_CODE('view')
  197. };
  198.  
  199. /* custom tags */
  200.  
  201. enum {
  202.     cmPS2CRDVMSizeTag            = FOUR_CHAR_CODE('psvm'),
  203.     cmVideoCardGammaTag            = FOUR_CHAR_CODE('vcgt')
  204. };
  205.  
  206. /* technology tag descriptions */
  207.  
  208. enum {
  209.     cmTechnologyFilmScanner        = FOUR_CHAR_CODE('fscn'),
  210.     cmTechnologyReflectiveScanner = FOUR_CHAR_CODE('rscn'),
  211.     cmTechnologyInkJetPrinter    = FOUR_CHAR_CODE('ijet'),
  212.     cmTechnologyThermalWaxPrinter = FOUR_CHAR_CODE('twax'),
  213.     cmTechnologyElectrophotographicPrinter = FOUR_CHAR_CODE('epho'),
  214.     cmTechnologyElectrostaticPrinter = FOUR_CHAR_CODE('esta'),
  215.     cmTechnologyDyeSublimationPrinter = FOUR_CHAR_CODE('dsub'),
  216.     cmTechnologyPhotographicPaperPrinter = FOUR_CHAR_CODE('rpho'),
  217.     cmTechnologyFilmWriter        = FOUR_CHAR_CODE('fprn'),
  218.     cmTechnologyVideoMonitor    = FOUR_CHAR_CODE('vidm'),
  219.     cmTechnologyVideoCamera        = FOUR_CHAR_CODE('vidc'),
  220.     cmTechnologyProjectionTelevision = FOUR_CHAR_CODE('pjtv'),
  221.     cmTechnologyCRTDisplay        = FOUR_CHAR_CODE('CRT '),
  222.     cmTechnologyPMDisplay        = FOUR_CHAR_CODE('PMD '),
  223.     cmTechnologyAMDisplay        = FOUR_CHAR_CODE('AMD '),
  224.     cmTechnologyPhotoCD            = FOUR_CHAR_CODE('KPCD'),
  225.     cmTechnologyPhotoImageSetter = FOUR_CHAR_CODE('imgs'),
  226.     cmTechnologyGravure            = FOUR_CHAR_CODE('grav'),
  227.     cmTechnologyOffsetLithography = FOUR_CHAR_CODE('offs'),
  228.     cmTechnologySilkscreen        = FOUR_CHAR_CODE('silk'),
  229.     cmTechnologyFlexography        = FOUR_CHAR_CODE('flex')
  230. };
  231.  
  232. /* public type signatures */
  233.  
  234. enum {
  235.     cmSigCurveType                = FOUR_CHAR_CODE('curv'),
  236.     cmSigDataType                = FOUR_CHAR_CODE('data'),
  237.     cmSigDateTimeType            = FOUR_CHAR_CODE('dtim'),
  238.     cmSigLut16Type                = FOUR_CHAR_CODE('mft2'),
  239.     cmSigLut8Type                = FOUR_CHAR_CODE('mft1'),
  240.     cmSigMeasurementType        = FOUR_CHAR_CODE('meas'),
  241.     cmSigNamedColorType            = FOUR_CHAR_CODE('ncol'),
  242.     cmSigNamedColor2Type        = FOUR_CHAR_CODE('ncl2'),
  243.     cmSigProfileDescriptionType    = FOUR_CHAR_CODE('desc'),
  244.     cmSigScreeningType            = FOUR_CHAR_CODE('scrn'),
  245.     cmSigS15Fixed16Type            = FOUR_CHAR_CODE('sf32'),
  246.     cmSigSignatureType            = FOUR_CHAR_CODE('sig '),
  247.     cmSigTextType                = FOUR_CHAR_CODE('text'),
  248.     cmSigU16Fixed16Type            = FOUR_CHAR_CODE('uf32'),
  249.     cmSigU1Fixed15Type            = FOUR_CHAR_CODE('uf16'),
  250.     cmSigUInt32Type                = FOUR_CHAR_CODE('ui32'),
  251.     cmSigUInt64Type                = FOUR_CHAR_CODE('ui64'),
  252.     cmSigUInt8Type                = FOUR_CHAR_CODE('ui08'),
  253.     cmSigViewingConditionsType    = FOUR_CHAR_CODE('view'),
  254.     cmSigXYZType                = FOUR_CHAR_CODE('XYZ ')
  255. };
  256.  
  257. /* custom type signatures */
  258.  
  259. enum {
  260.     cmSigVideoCardGammaType        = FOUR_CHAR_CODE('vcgt')
  261. };
  262.  
  263.  
  264. /* Measurement type encodings */
  265. /* Measurement Flare */
  266.  
  267. enum {
  268.     cmFlare0                    = 0x00000000,
  269.     cmFlare100                    = 0x00000001
  270. };
  271.  
  272. /* Measurement Geometry    */
  273.  
  274. enum {
  275.     cmGeometryUnknown            = 0x00000000,
  276.     cmGeometry045or450            = 0x00000001,
  277.     cmGeometry0dord0            = 0x00000002
  278. };
  279.  
  280. /* Standard Observer    */
  281.  
  282. enum {
  283.     cmStdobsUnknown                = 0x00000000,
  284.     cmStdobs1931TwoDegrees        = 0x00000001,
  285.     cmStdobs1964TenDegrees        = 0x00000002
  286. };
  287.  
  288. /* Standard Illuminant */
  289.  
  290. enum {
  291.     cmIlluminantUnknown            = 0x00000000,
  292.     cmIlluminantD50                = 0x00000001,
  293.     cmIlluminantD65                = 0x00000002,
  294.     cmIlluminantD93                = 0x00000003,
  295.     cmIlluminantF2                = 0x00000004,
  296.     cmIlluminantD55                = 0x00000005,
  297.     cmIlluminantA                = 0x00000006,
  298.     cmIlluminantEquiPower        = 0x00000007,
  299.     cmIlluminantF8                = 0x00000008
  300. };
  301.  
  302. /* Spot Function Value */
  303.  
  304. enum {
  305.     cmSpotFunctionUnknown        = 0,
  306.     cmSpotFunctionDefault        = 1,
  307.     cmSpotFunctionRound            = 2,
  308.     cmSpotFunctionDiamond        = 3,
  309.     cmSpotFunctionEllipse        = 4,
  310.     cmSpotFunctionLine            = 5,
  311.     cmSpotFunctionSquare        = 6,
  312.     cmSpotFunctionCross            = 7
  313. };
  314.  
  315. /* Color Space Signatures */
  316.  
  317. enum {
  318.     cmXYZData                    = FOUR_CHAR_CODE('XYZ '),
  319.     cmLabData                    = FOUR_CHAR_CODE('Lab '),
  320.     cmLuvData                    = FOUR_CHAR_CODE('Luv '),
  321.     cmYxyData                    = FOUR_CHAR_CODE('Yxy '),
  322.     cmRGBData                    = FOUR_CHAR_CODE('RGB '),
  323.     cmGrayData                    = FOUR_CHAR_CODE('GRAY'),
  324.     cmHSVData                    = FOUR_CHAR_CODE('HSV '),
  325.     cmHLSData                    = FOUR_CHAR_CODE('HLS '),
  326.     cmCMYKData                    = FOUR_CHAR_CODE('CMYK'),
  327.     cmCMYData                    = FOUR_CHAR_CODE('CMY '),
  328.     cmMCH5Data                    = FOUR_CHAR_CODE('MCH5'),
  329.     cmMCH6Data                    = FOUR_CHAR_CODE('MCH6'),
  330.     cmMCH7Data                    = FOUR_CHAR_CODE('MCH7'),
  331.     cmMCH8Data                    = FOUR_CHAR_CODE('MCH8'),
  332.     cmNamedData                    = FOUR_CHAR_CODE('NAME')
  333. };
  334.  
  335. /* profileClass enumerations */
  336.  
  337. enum {
  338.     cmInputClass                = FOUR_CHAR_CODE('scnr'),
  339.     cmDisplayClass                = FOUR_CHAR_CODE('mntr'),
  340.     cmOutputClass                = FOUR_CHAR_CODE('prtr'),
  341.     cmLinkClass                    = FOUR_CHAR_CODE('link'),
  342.     cmAbstractClass                = FOUR_CHAR_CODE('abst'),
  343.     cmColorSpaceClass            = FOUR_CHAR_CODE('spac'),
  344.     cmNamedColorClass            = FOUR_CHAR_CODE('nmcl')
  345. };
  346.  
  347. /* platform enumerations */
  348.  
  349. enum {
  350.     cmMacintosh                    = FOUR_CHAR_CODE('APPL'),
  351.     cmMicrosoft                    = FOUR_CHAR_CODE('MSFT'),
  352.     cmSolaris                    = FOUR_CHAR_CODE('SUNW'),
  353.     cmSiliconGraphics            = FOUR_CHAR_CODE('SGI '),
  354.     cmTaligent                    = FOUR_CHAR_CODE('TGNT')
  355. };
  356.  
  357. /* ColorSync 1.0 elements */
  358.  
  359. enum {
  360.     cmCS1ChromTag                = FOUR_CHAR_CODE('chrm'),
  361.     cmCS1TRCTag                    = FOUR_CHAR_CODE('trc '),
  362.     cmCS1NameTag                = FOUR_CHAR_CODE('name'),
  363.     cmCS1CustTag                = FOUR_CHAR_CODE('cust')
  364. };
  365.  
  366. /* General element data types */
  367.  
  368. struct CMDateTime {
  369.     unsigned short                     year;
  370.     unsigned short                     month;
  371.     unsigned short                     dayOfTheMonth;
  372.     unsigned short                     hours;
  373.     unsigned short                     minutes;
  374.     unsigned short                     seconds;
  375. };
  376. typedef struct CMDateTime                CMDateTime;
  377.  
  378. struct CMFixedXYZColor {
  379.     Fixed                             X;
  380.     Fixed                             Y;
  381.     Fixed                             Z;
  382. };
  383. typedef struct CMFixedXYZColor            CMFixedXYZColor;
  384.  
  385. typedef unsigned short                     CMXYZComponent;
  386.  
  387. struct CMXYZColor {
  388.     CMXYZComponent                     X;
  389.     CMXYZComponent                     Y;
  390.     CMXYZComponent                     Z;
  391. };
  392. typedef struct CMXYZColor                CMXYZColor;
  393.  
  394. struct CM2Header {
  395.     unsigned long                     size;                        /* This is the total size of the Profile */
  396.     OSType                             CMMType;                    /* CMM signature,  Registered with CS2 consortium  */
  397.     unsigned long                     profileVersion;                /* Version of CMProfile format */
  398.     OSType                             profileClass;                /* input, display, output, devicelink, abstract, or color conversion profile type */
  399.     OSType                             dataColorSpace;                /* color space of data */
  400.     OSType                             profileConnectionSpace;        /* profile connection color space */
  401.     CMDateTime                         dateTime;                    /* date and time of profile creation */
  402.     OSType                             CS2profileSignature;        /* 'acsp' constant ColorSync 2.0 file ID */
  403.     OSType                             platform;                    /* primary profile platform, Registered with CS2 consortium */
  404.     unsigned long                     flags;                        /* profile flags */
  405.     OSType                             deviceManufacturer;            /* Registered with ICC consortium */
  406.     unsigned long                     deviceModel;                /* Registered with ICC consortium */
  407.     unsigned long                     deviceAttributes[2];        /* Attributes like paper type */
  408.     unsigned long                     renderingIntent;            /* preferred rendering intent of tagged object */
  409.     CMFixedXYZColor                 white;                        /* profile illuminant */
  410.     OSType                             creator;                    /* profile creator */
  411.     char                             reserved[44];                /* reserved for future use */
  412. };
  413. typedef struct CM2Header                CM2Header;
  414.  
  415. struct CMTagRecord {
  416.     OSType                             tag;                        /* Registered with CS2 consortium */
  417.     unsigned long                     elementOffset;                /* Relative to start of CMProfile */
  418.     unsigned long                     elementSize;
  419. };
  420. typedef struct CMTagRecord                CMTagRecord;
  421.  
  422. struct CMTagElemTable {
  423.     unsigned long                     count;
  424.     CMTagRecord                     tagList[1];                    /* Variable size */
  425. };
  426. typedef struct CMTagElemTable            CMTagElemTable;
  427. /* External 0x02002001 CMProfile */
  428.  
  429. struct CM2Profile {
  430.     CM2Header                         header;
  431.     CMTagElemTable                     tagTable;
  432.     char                             elemData[1];                /* Tagged element storage. Variable size */
  433. };
  434. typedef struct CM2Profile                CM2Profile;
  435. typedef CM2Profile *                    CM2ProfilePtr;
  436. typedef CM2ProfilePtr *                    CM2ProfileHandle;
  437. /* Tag Type Definitions */
  438.  
  439. struct CMCurveType {
  440.     OSType                             typeDescriptor;                /* 'curv' */
  441.     unsigned long                     reserved;                    /* fill with 0x00 */
  442.     unsigned long                     countValue;                    /* number of entries in table that follows */
  443.     unsigned short                     data[1];                    /* Tagged element storage. Variable size */
  444. };
  445. typedef struct CMCurveType                CMCurveType;
  446.  
  447. struct CMDataType {
  448.     OSType                             typeDescriptor;                /* 'data' */
  449.     unsigned long                     reserved;                    /* fill with 0x00 */
  450.     unsigned long                     dataFlag;                    /* 0 = ASCII, 1 = binary */
  451.     char                             data[1];                    /* Tagged element storage. Variable size */
  452. };
  453. typedef struct CMDataType                CMDataType;
  454.  
  455. struct CMDateTimeType {
  456.     OSType                             typeDescriptor;                /* 'dtim' */
  457.     unsigned long                     reserved;
  458.     CMDateTime                         dateTime;
  459. };
  460. typedef struct CMDateTimeType            CMDateTimeType;
  461.  
  462. struct CMLut16Type {
  463.     OSType                             typeDescriptor;                /* 'mft2' */
  464.     unsigned long                     reserved;                    /* fill with 0x00 */
  465.     unsigned char                     inputChannels;                /* Number of input channels */
  466.     unsigned char                     outputChannels;                /* Number of output channels */
  467.     unsigned char                     gridPoints;                    /* Number of clutTable grid points */
  468.     unsigned char                     reserved2;                    /* fill with 0x00 */
  469.     Fixed                             matrix[3][3];                /* */
  470.     unsigned short                     inputTableEntries;            /* */
  471.     unsigned short                     outputTableEntries;            /* */
  472.     unsigned short                     inputTable[1];                /* Variable size */
  473.     unsigned short                     CLUT[1];                    /* Variable size */
  474.     unsigned short                     outputTable[1];                /* Variable size */
  475. };
  476. typedef struct CMLut16Type                CMLut16Type;
  477.  
  478. struct CMLut8Type {
  479.     OSType                             typeDescriptor;                /* 'mft1' */
  480.     unsigned long                     reserved;                    /* fill with 0x00 */
  481.     unsigned char                     inputChannels;                /* */
  482.     unsigned char                     outputChannels;                /* */
  483.     unsigned char                     gridPoints;                    /* */
  484.     unsigned char                     reserved2;                    /* fill with 0x00 */
  485.     Fixed                             matrix[3][3];                /* */
  486.     unsigned char                     inputTable[256];            /* fixed size of 256 */
  487.     unsigned char                     CLUT[2];                    /* Variable size */
  488.     unsigned char                     outputTable[256];            /* fixed size of 256 */
  489. };
  490. typedef struct CMLut8Type                CMLut8Type;
  491.  
  492. struct CMMeasurementType {
  493.     OSType                             typeDescriptor;                /* 'meas' */
  494.     unsigned long                     reserved;                    /* fill with 0x00 */
  495.     unsigned long                     standardObserver;            /* 0 : unknown, 1 : CIE 1931, 2 : CIE 1964 */
  496.     CMFixedXYZColor                 backingXYZ;                    /* absolute XYZ values of backing */
  497.     unsigned long                     geometry;                    /* 0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0 */
  498.     unsigned long                     flare;                        /* 0 : 0%, 1 : 100% flare */
  499.     unsigned long                     illuminant;                    /* standard illuminant */
  500. };
  501. typedef struct CMMeasurementType        CMMeasurementType;
  502.  
  503. struct CMNamedColorType {
  504.     OSType                             typeDescriptor;                /* 'ncol' */
  505.     unsigned long                     reserved;                    /* fill with 0x00 */
  506.     unsigned long                     vendorFlag;                    /* */
  507.     unsigned long                     count;                        /* count of named colors in array that follows */
  508.     unsigned char                     prefixName[1];                /* Variable size, max = 32, to access fields after this one, have to count bytes */
  509.     unsigned char                     suffixName[1];                /* Variable size, max = 32 */
  510.     char                             data[1];                    /* varaible size data as explained below */
  511. };
  512. typedef struct CMNamedColorType            CMNamedColorType;
  513. /*    
  514.     A variable size array of structs appears as the last block of data
  515.     in the above struct, CMNamedColorType.  The data structure
  516.     is as follows: (example in C)
  517.     
  518.     struct {                                             
  519.         unsigned char    rootName[1];                 * Variable size, max = 32 
  520.         unsigned char    colorCoords[1];                 * Variable size  
  521.     } colorName[1];                                     * Variable size  
  522. */
  523.  
  524. struct CMNamedColor2Type {
  525.     OSType                             typeDescriptor;                /* 'ncl2' */
  526.     unsigned long                     reserved;                    /* fill with 0x00 */
  527.     unsigned long                     vendorFlag;                    /* lower 16 bits reserved for ICC use */
  528.     unsigned long                     count;                        /* count of named colors in array that follows */
  529.     unsigned long                     deviceChannelCount;            /* number of device channels, 0 indicates no device value available */
  530.     unsigned char                     prefixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  531.     unsigned char                     suffixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  532.     char                             data[1];                    /* varaible size data as explained below */
  533. };
  534. typedef struct CMNamedColor2Type        CMNamedColor2Type;
  535. /*    
  536.     A variable size array of structs appears as the last block of data
  537.     in the above struct, CMNamedColor2Type.  The data structure
  538.     is as follows: (example in C)
  539.     
  540.     struct {                                             
  541.         unsigned char    rootName[1];                 * 32 byte field.  7 bit ASCII null terminated
  542.         unsigned char    PCSColorCoords[1];             * Variable size  
  543.         unsigned char    DeviceColorCoords[1];         * Variable size  
  544.     } colorName2[1];                                 * Variable size  
  545. */
  546.  
  547.  
  548. struct CMTextDescriptionType {
  549.     OSType                             typeDescriptor;                /* 'desc' */
  550.     unsigned long                     reserved;                    /* fill with 0x00 */
  551.     unsigned long                     ASCIICount;                    /* the count of "bytes" */
  552.     unsigned char                     ASCIIName[2];                /* Variable size, to access fields after this one, have to count bytes */
  553.     unsigned long                     UniCodeCode;
  554.     unsigned long                     UniCodeCount;                /* the count of characters, each character has two bytes */
  555.     unsigned char                     UniCodeName[2];                /* Variable size */
  556.     short                             ScriptCodeCode;
  557.     unsigned char                     ScriptCodeCount;            /* the count of "bytes" */
  558.     unsigned char                     ScriptCodeName[2];            /* Variable size */
  559. };
  560. typedef struct CMTextDescriptionType    CMTextDescriptionType;
  561.  
  562. struct CMTextType {
  563.     OSType                             typeDescriptor;                /* 'text' */
  564.     unsigned long                     reserved;                    /* fill with 0x00 */
  565.     unsigned char                     text[1];                    /* count of text is obtained from tag size element */
  566. };
  567. typedef struct CMTextType                CMTextType;
  568.  
  569. struct CMScreeningType {
  570.     OSType                             typeDescriptor;                /* 'scrn' */
  571.     unsigned long                     reserved;                    /* fill with 0x00 */
  572.     unsigned long                     screeningFlag;                /* bit 0 : use printer default screens, bit 1 : inch/cm */
  573.     unsigned long                     channelCount;
  574.     char                             data[1];                    /* varaible size data as explained below */
  575. };
  576. typedef struct CMScreeningType            CMScreeningType;
  577. /*
  578.     A variable size array of structs appears as the last block of data
  579.     in the above struct, CMScreeningType.  The data structure
  580.     is as follows: (example in C)
  581.     
  582.     struct {
  583.         Fixed            frequency;
  584.         Fixed            angle;
  585.         unsigned long    sportFunction;
  586.      }    channelScreening[1];                        * Variable size 
  587. */
  588.  
  589. struct CMSignatureType {
  590.     OSType                             typeDescriptor;                /* 'sig ' */
  591.     unsigned long                     reserved;                    /* fill with 0x00 */
  592.     OSType                             signature;
  593. };
  594. typedef struct CMSignatureType            CMSignatureType;
  595.  
  596. struct CMS15Fixed16ArrayType {
  597.     OSType                             typeDescriptor;                /* 'sf32' */
  598.     unsigned long                     reserved;                    /* fill with 0x00 */
  599.     Fixed                             value[1];                    /* Variable size */
  600. };
  601. typedef struct CMS15Fixed16ArrayType    CMS15Fixed16ArrayType;
  602.  
  603. struct CMU16Fixed16ArrayType {
  604.     OSType                             typeDescriptor;                /* 'uf32' */
  605.     unsigned long                     reserved;                    /* fill with 0x00 */
  606.     unsigned long                     value[1];                    /* Variable size */
  607. };
  608. typedef struct CMU16Fixed16ArrayType    CMU16Fixed16ArrayType;
  609.  
  610. struct CMUInt16ArrayType {
  611.     OSType                             typeDescriptor;                /* 'ui16' */
  612.     unsigned long                     reserved;                    /* fill with 0x00 */
  613.     unsigned short                     value[1];                    /* Variable size */
  614. };
  615. typedef struct CMUInt16ArrayType        CMUInt16ArrayType;
  616.  
  617. struct CMUInt32ArrayType {
  618.     OSType                             typeDescriptor;                /* 'ui32' */
  619.     unsigned long                     reserved;                    /* fill with 0x00 */
  620.     unsigned long                     value[1];                    /* Variable size */
  621. };
  622. typedef struct CMUInt32ArrayType        CMUInt32ArrayType;
  623.  
  624. struct CMUInt64ArrayType {
  625.     OSType                             typeDescriptor;                /* 'ui64' */
  626.     unsigned long                     reserved;                    /* fill with 0x00 */
  627.     unsigned long                     value[1];                    /* Variable size (x2) */
  628. };
  629. typedef struct CMUInt64ArrayType        CMUInt64ArrayType;
  630.  
  631. struct CMUInt8ArrayType {
  632.     OSType                             typeDescriptor;                /* 'ui08' */
  633.     unsigned long                     reserved;                    /* fill with 0x00 */
  634.     unsigned char                     value[1];                    /* Variable size */
  635. };
  636. typedef struct CMUInt8ArrayType            CMUInt8ArrayType;
  637.  
  638. struct CMViewingConditionsType {
  639.     OSType                             typeDescriptor;                /* 'view' */
  640.     unsigned long                     reserved;                    /* fill with 0x00 */
  641.     CMFixedXYZColor                 illuminant;                    /* absolute XYZs of illuminant  in cd/m^2 */
  642.     CMFixedXYZColor                 surround;                    /* absolute XYZs of surround in cd/m^2 */
  643.     unsigned long                     stdIlluminant;                /* see definitions of std illuminants */
  644. };
  645. typedef struct CMViewingConditionsType    CMViewingConditionsType;
  646.  
  647. struct CMXYZType {
  648.     OSType                             typeDescriptor;                /* 'XYZ ' */
  649.     unsigned long                     reserved;                    /* fill with 0x00 */
  650.     CMFixedXYZColor                 XYZ[1];                        /* variable size XYZ tristimulus values */
  651. };
  652. typedef struct CMXYZType                CMXYZType;
  653. /* Profile sequence description type */
  654.  
  655. struct CMProfileSequenceDescType {
  656.     OSType                             typeDescriptor;                /* 'pseq ' */
  657.     unsigned long                     reserved;                    /* fill with 0x00 */
  658.     unsigned long                     count;                        /* Number of descriptions */
  659.     char                             data[1];                    /* varaible size data as explained below */
  660. };
  661. typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
  662. /*
  663.     A variable size array of structs appears as the last block of data
  664.     in the above struct, CMProfileSequenceDescType.  The data structure
  665.     is as follows: (example in C)
  666.     
  667.     struct {                                             
  668.         OSType            deviceMfg;                     * Device Manufacturer 
  669.         OSType            deviceModel;                 * Decvice Model 
  670.         unsigned long    attributes[2];                 * Device attributes 
  671.         OSType            technology;                     * Technology signature 
  672.         unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  673.         unsigned char    mfgDescASCIIName[2];         * Variable size 
  674.         unsigned long    mfgDescUniCodeCode;             
  675.         unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  676.         unsigned char    mfgDescUniCodeName[2];         * Variable size 
  677.         unsigned long    mfgDescScriptCodeCode;         
  678.         unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  679.         unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  680.         unsigned long    modelDescASCIICount;         * the count of "bytes" 
  681.         unsigned char    modelDescASCIIName[2];         * Variable size 
  682.         unsigned long    modelDescUniCodeCode;         
  683.         unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  684.         unsigned char    modelDescUniCodeName[2];     * Variable size 
  685.         short            modelDescScriptCodeCode;     
  686.         unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  687.         SInt8            filler;                         * For proper alignment across languages 
  688.         unsigned char    modelDescScriptCodeName[2];     * Variable size 
  689.     }    profileDescription[1];                         
  690. */
  691.  
  692. /* Under color removal, black generation type */
  693.  
  694. struct CMUcrBgType {
  695.     OSType                             typeDescriptor;                /* 'bfd  ' */
  696.     unsigned long                     reserved;                    /* fill with 0x00 */
  697.     unsigned long                     ucrCount;                    /* Number of UCR entries */
  698.     unsigned short                     ucrValues[1];                /* variable size */
  699.     unsigned long                     bgCount;                    /* Number of BG entries */
  700.     unsigned short                     bgValues[1];                /* variable size */
  701.     unsigned char                     ucrbgASCII[1];                /* null terminated ASCII string */
  702. };
  703. typedef struct CMUcrBgType                CMUcrBgType;
  704.  
  705. struct CMIntentCRDVMSize {
  706.     long                             renderingIntent;            /* rendering intent */
  707.     unsigned long                     VMSize;                        /* VM size taken up by the CRD */
  708. };
  709. typedef struct CMIntentCRDVMSize        CMIntentCRDVMSize;
  710.  
  711. struct CMPS2CRDVMSizeType {
  712.     OSType                             typeDescriptor;                /* 'psvm' */
  713.     unsigned long                     reserved;                    /* fill with 0x00 */
  714.     unsigned long                     count;                        /* number of intent entries */
  715.     CMIntentCRDVMSize                 intentCRD[1];                /* variable size */
  716. };
  717. typedef struct CMPS2CRDVMSizeType        CMPS2CRDVMSizeType;
  718. /* Video Card Gamma type */
  719.  
  720. enum {
  721.     cmVideoCardGammaTableType    = 0,
  722.     cmVideoCardGammaFormulaType    = 1
  723. };
  724.  
  725.  
  726.  
  727. struct CMVideoCardGammaTable {
  728.     unsigned short                     channels;                    /* # of gamma channels (1 or 3) */
  729.     unsigned short                     entryCount;                    /* 1-based number of entries per channel */
  730.     unsigned short                     entrySize;                    /* size on bytes of each entry */
  731.     char                             data[1];                    /* variable size data follows */
  732. };
  733. typedef struct CMVideoCardGammaTable    CMVideoCardGammaTable;
  734.  
  735. struct CMVideoCardGammaFormula {
  736.     Fixed                             redGamma;                    /* must be > 0.0 */
  737.     Fixed                             redMin;                        /* must be > 0.0 and < 1.0 */
  738.     Fixed                             redMax;                        /* must be > 0.0 and < 1.0 */
  739.     Fixed                             greenGamma;                    /* must be > 0.0 */
  740.     Fixed                             greenMin;                    /* must be > 0.0 and < 1.0 */
  741.     Fixed                             greenMax;                    /* must be > 0.0 and < 1.0 */
  742.     Fixed                             blueGamma;                    /* must be > 0.0 */
  743.     Fixed                             blueMin;                    /* must be > 0.0 and < 1.0 */
  744.     Fixed                             blueMax;                    /* must be > 0.0 and < 1.0 */
  745. };
  746. typedef struct CMVideoCardGammaFormula    CMVideoCardGammaFormula;
  747.  
  748. struct CMVideoCardGamma {
  749.     unsigned long                     tagType;
  750.     union {
  751.         CMVideoCardGammaTable             table;
  752.         CMVideoCardGammaFormula         formula;
  753.     }                                 u;
  754. };
  755. typedef struct CMVideoCardGamma            CMVideoCardGamma;
  756.  
  757. struct CMVideoCardGammaType {
  758.     OSType                             typeDescriptor;                /* 'vcgt' */
  759.     unsigned long                     reserved;                    /* fill with 0x00 */
  760.     CMVideoCardGamma                 gamma;
  761. };
  762. typedef struct CMVideoCardGammaType        CMVideoCardGammaType;
  763. /************************************************************************/
  764. /*************** ColorSync 1.0 profile specification ********************/
  765. /************************************************************************/
  766.  
  767. enum {
  768.     cmGrayResponse                = 0,
  769.     cmRedResponse                = 1,
  770.     cmGreenResponse                = 2,
  771.     cmBlueResponse                = 3,
  772.     cmCyanResponse                = 4,
  773.     cmMagentaResponse            = 5,
  774.     cmYellowResponse            = 6,
  775.     cmUcrResponse                = 7,
  776.     cmBgResponse                = 8,
  777.     cmOnePlusLastResponse        = 9
  778. };
  779.  
  780.  
  781. /* Device types */
  782.  
  783. enum {
  784.     cmMonitorDevice                = FOUR_CHAR_CODE('mntr'),
  785.     cmScannerDevice                = FOUR_CHAR_CODE('scnr'),
  786.     cmPrinterDevice                = FOUR_CHAR_CODE('prtr')
  787. };
  788.  
  789.  
  790.  
  791. struct CMIString {
  792.     ScriptCode                         theScript;
  793.     Str63                             theString;
  794. };
  795. typedef struct CMIString                CMIString;
  796. /* Profile options */
  797.  
  798. enum {
  799.     cmPerceptualMatch            = 0x0000,                        /* Default. For photographic images */
  800.     cmColorimetricMatch            = 0x0001,                        /* Exact matching when possible */
  801.     cmSaturationMatch            = 0x0002                        /* For solid colors */
  802. };
  803.  
  804. /* Profile flags */
  805.  
  806. enum {
  807.     cmNativeMatchingPreferred    = 0x00000001,                    /* Default to native not preferred */
  808.     cmTurnOffCache                = 0x00000002                    /* Default to turn on CMM cache */
  809. };
  810.  
  811.  
  812. typedef long                             CMMatchOption;
  813. typedef long                             CMMatchFlag;
  814.  
  815. struct CMHeader {
  816.     unsigned long                     size;
  817.     OSType                             CMMType;
  818.     unsigned long                     applProfileVersion;
  819.     OSType                             dataType;
  820.     OSType                             deviceType;
  821.     OSType                             deviceManufacturer;
  822.     unsigned long                     deviceModel;
  823.     unsigned long                     deviceAttributes[2];
  824.     unsigned long                     profileNameOffset;
  825.     unsigned long                     customDataOffset;
  826.     CMMatchFlag                     flags;
  827.     CMMatchOption                     options;
  828.     CMXYZColor                         white;
  829.     CMXYZColor                         black;
  830. };
  831. typedef struct CMHeader                    CMHeader;
  832.  
  833. struct CMProfileChromaticities {
  834.     CMXYZColor                         red;
  835.     CMXYZColor                         green;
  836.     CMXYZColor                         blue;
  837.     CMXYZColor                         cyan;
  838.     CMXYZColor                         magenta;
  839.     CMXYZColor                         yellow;
  840. };
  841. typedef struct CMProfileChromaticities    CMProfileChromaticities;
  842.  
  843. struct CMProfileResponse {
  844.     unsigned short                     counts[9];
  845.     unsigned short                     data[1];                    /* Variable size */
  846. };
  847. typedef struct CMProfileResponse        CMProfileResponse;
  848.  
  849. struct CMProfile {
  850.     CMHeader                         header;
  851.     CMProfileChromaticities         profile;
  852.     CMProfileResponse                 response;
  853.     CMIString                         profileName;
  854.     char                             customData[1];                /* Variable size */
  855. };
  856. typedef struct CMProfile                CMProfile;
  857. typedef CMProfile *                        CMProfilePtr;
  858. typedef CMProfilePtr *                    CMProfileHandle;
  859. #if OLDROUTINENAMES
  860.  
  861. enum {
  862.     kCMApplProfileVersion        = cmCS1ProfileVersion
  863. };
  864.  
  865.  
  866. enum {
  867.     grayResponse                = cmGrayResponse,
  868.     redResponse                    = cmRedResponse,
  869.     greenResponse                = cmGreenResponse,
  870.     blueResponse                = cmBlueResponse,
  871.     cyanResponse                = cmCyanResponse,
  872.     magentaResponse                = cmMagentaResponse,
  873.     yellowResponse                = cmYellowResponse,
  874.     ucrResponse                    = cmUcrResponse,
  875.     bgResponse                    = cmBgResponse,
  876.     onePlusLastResponse            = cmOnePlusLastResponse
  877. };
  878.  
  879.  
  880. enum {
  881.     rgbData                        = cmRGBData,
  882.     cmykData                    = cmCMYKData,
  883.     grayData                    = cmGrayData,
  884.     xyzData                        = cmXYZData
  885. };
  886.  
  887.  
  888. enum {
  889.     XYZData                        = cmXYZData
  890. };
  891.  
  892.  
  893. enum {
  894.     monitorDevice                = cmMonitorDevice,
  895.     scannerDevice                = cmScannerDevice,
  896.     printerDevice                = cmPrinterDevice
  897. };
  898.  
  899.  
  900. enum {
  901.     CMNativeMatchingPreferred    = cmNativeMatchingPreferred,    /* Default to native not preferred */
  902.     CMTurnOffCache                = cmTurnOffCache                /* Default to turn on CMM cache */
  903. };
  904.  
  905.  
  906. enum {
  907.     CMPerceptualMatch            = cmPerceptualMatch,            /* Default. For photographic images */
  908.     CMColorimetricMatch            = cmColorimetricMatch,            /* Exact matching when possible */
  909.     CMSaturationMatch            = cmSaturationMatch                /* For solid colors */
  910. };
  911.  
  912.  
  913. typedef unsigned short                     XYZComponent;
  914. typedef CMXYZColor                         XYZColor;
  915. typedef unsigned short                     CMResponseData;
  916. typedef CMIString                         IString;
  917. typedef long                             CMResponseColor;
  918. typedef CMResponseColor                 responseColor;
  919. #endif  /* OLDROUTINENAMES */
  920.  
  921.  
  922.  
  923. #if PRAGMA_STRUCT_ALIGN
  924.     #pragma options align=reset
  925. #elif PRAGMA_STRUCT_PACKPUSH
  926.     #pragma pack(pop)
  927. #elif PRAGMA_STRUCT_PACK
  928.     #pragma pack()
  929. #endif
  930.  
  931. #ifdef PRAGMA_IMPORT_OFF
  932. #pragma import off
  933. #elif PRAGMA_IMPORT
  934. #pragma import reset
  935. #endif
  936.  
  937. #ifdef __cplusplus
  938. }
  939. #endif
  940.  
  941. #endif /* __CMICCPROFILE__ */
  942.  
  943.